package com.zsr.xmall.member.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zsr.common.to.member.MemberUserLoginTO;
import com.zsr.common.to.member.MemberUserRegisterTO;
import com.zsr.common.utils.PageUtils;
import com.zsr.common.vo.auth.BaseSocialUser;
import com.zsr.xmall.member.entity.MemberEntity;
import com.zsr.xmall.member.exception.PhoneExistException;
import com.zsr.xmall.member.exception.UserNameExistException;

import java.util.Map;

/**
 * 会员
 *
 * @author zsrey
 * @email zsrey8880@163.com
 * @date 2022-06-09 23:28:54
 */
public interface MemberService extends IService<MemberEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 注册
     *
     * @param userRegisterTo
     */
    void register(MemberUserRegisterTO userRegisterTo);

    void checkPhoneUnique(String phone) throws PhoneExistException;

    void checkUserNameUnique(String username) throws UserNameExistException;

    MemberEntity login(MemberUserLoginTO userLoginTo);

    MemberEntity login(BaseSocialUser baseSocialUser) throws Exception;
}

